﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HR_Business
{
    public partial class Department
    {
         HRDBContext _DatabaseContext;

        public Department() : this(new HRDBContext()) { }

        public Department(HRDBContext HRDBContext)
        {
            _DatabaseContext = HRDBContext;
        }
       
        public Department GetDepartmentByDepartmentId(int DepartmentId)
        {
            return _DatabaseContext.Departments.FirstOrDefault(Department => Department.Id == DepartmentId);
        }

        public List<Department> GetAllDepartments()
        {
            return _DatabaseContext.Departments.ToList();
        }

    }
}
